import React, { Component, Fragment } from 'react'
import { Route, Redirect, Switch } from 'react-router-dom'
import { BackTop } from 'antd';
import Home from './pages/home'
import Coures from './pages/course'
import CourseDetail from './pages/course/course_detail'
import CourseMore from './pages/course/course_more'
import Videos from './pages/videos'
import Blog from './pages/blog'
import BlogDetail from './pages/blog/blog_detail'
import BlogPublish from './pages/blog/blog_publish'
import Resource from './pages/resource'
import Guide from './pages/guide'
import Our from './pages/our'
import Own from './pages/own'
import Search from './pages/search'
export default class App extends Component {
  render() {
    return (
      <Fragment>
        {/* 回到顶部 */}
        <BackTop/>
        {/* 路由 */}
        <Switch>
          <Route path="/home" component={Home} />
          <Route path="/course" component={Coures} />
          <Route path="/course-detail" component={CourseDetail}/>
          <Route path="/course-more" component={CourseMore}/>
          <Route path="/videos" component={Videos} />
          <Route path="/blog" component={Blog} />
          <Route path="/blog-detail" component={BlogDetail} />
          <Route path="/blog-publish" component={BlogPublish} />
          <Route path="/resource" component={Resource} />
          <Route path="/guide" component={Guide} />
          <Route path="/our" component={Our} />
          <Route path="/own" component={Own} />
          <Route path="/search" component={Search} />
          <Redirect to="/home" />
        </Switch>
      </Fragment>
    )
  }
}
